package com.itita.ww2.handler.requesthandler.alliance;

import com.itita.ww2.core.AbstractClientRequestHandler;
import com.itita.ww2.game.alliance.AllianceService;
import com.itita.ww2.handler.requesthandler.alliance.manager.AlCancelDisband;
import com.itita.ww2.handler.requesthandler.alliance.manager.AlCancelTransfer;
import com.itita.ww2.handler.requesthandler.alliance.manager.AlDisbandRequest;
import com.itita.ww2.handler.requesthandler.alliance.manager.AlModifyAttr;
import com.itita.ww2.handler.requesthandler.alliance.manager.AlTransferRequest;
import com.itita.ww2.handler.requesthandler.alliance.manager.AllianceCreate;
import com.itita.ww2.handler.requesthandler.alliance.manager.ListJoinRequest;
import com.itita.ww2.handler.requesthandler.alliance.member.AlAppoint;
import com.itita.ww2.handler.requesthandler.alliance.member.AlJoinReceipt;
import com.itita.ww2.handler.requesthandler.alliance.member.AlJoinRequest;
import com.itita.ww2.handler.requesthandler.alliance.member.AlKickUser;
import com.itita.ww2.handler.requesthandler.alliance.member.AlQuit;
import com.itita.ww2.handler.requesthandler.alliance.member.AlRecall;
import com.smartfoxserver.v2.annotations.MultiHandler;

@MultiHandler
public class AllianceHandler extends AbstractClientRequestHandler {
	// private static final Logger logger = LoggerFactory.getLogger(AllianceHandler.class);
	//
	public static final String COMMAND_PREFIX = "alliance";

	@Override
	protected void init() {
		initialize();

		addClientRequestItem("create", AllianceCreate.class); // 创建联盟
		addClientRequestItem("join_request", AlJoinRequest.class); // 加入联盟请求
		addClientRequestItem("join_receipt", AlJoinReceipt.class); // 回执加入请求
		addClientRequestItem("quit", AlQuit.class); // 退出联盟
		addClientRequestItem("appoint", AlAppoint.class); // 任命玩家
		addClientRequestItem("kick", AlKickUser.class); // 踢出玩家
		addClientRequestItem("modify_attr", AlModifyAttr.class); // 修改联盟参数
		addClientRequestItem("disband_request", AlDisbandRequest.class); // 发起解散联盟请求
		addClientRequestItem("disband_cancel", AlCancelDisband.class); // 取消解散联盟
		// addClientRequestItem("getdata", AlGetData.class); // 获取联盟数据
		addClientRequestItem("listuser", AlListUser.class); // 获取联盟玩家列表
		addClientRequestItem("listjoinrequest", ListJoinRequest.class); // 获取联盟加入请求列表
		addClientRequestItem("listalliance", AlListAlliance.class); // 获取联盟列表
		addClientRequestItem("recall", AlRecall.class); // 罢免职位
		addClientRequestItem("transfer_request", AlTransferRequest.class); // 发起转让联盟请求
		addClientRequestItem("transfer_cancel", AlCancelTransfer.class); // 取消转让联盟请求
	}

	public void initialize() {
		// 重启联盟任务
		AllianceService.restartAllianceTask();
	}

	@Override
	protected void setCommandPrefix() {
		super.cmd_prefix = COMMAND_PREFIX;
	}

}
